//
//	MVMvShowPlay.m
//
//	Create by mafeng on 13/8/2016
//	Copyright © 2016. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "MVMvShowPlay.h"

NSString *const kMVMvShowPlayMvvid = @"mvvid";
NSString *const kMVMvShowPlayPicurl = @"picurl";
NSString *const kMVMvShowPlayPlayid = @"playid";
NSString *const kMVMvShowPlayPlayurl = @"playurl";
NSString *const kMVMvShowPlaySubtitle = @"subtitle";
NSString *const kMVMvShowPlayTitle = @"title";
NSString *const kMVMvShowPlayType = @"type";

@interface MVMvShowPlay ()
@end
@implementation MVMvShowPlay




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kMVMvShowPlayMvvid] isKindOfClass:[NSNull class]]){
		self.mvvid = dictionary[kMVMvShowPlayMvvid];
	}	
	if(![dictionary[kMVMvShowPlayPicurl] isKindOfClass:[NSNull class]]){
		self.picurl = dictionary[kMVMvShowPlayPicurl];
	}	
	if(![dictionary[kMVMvShowPlayPlayid] isKindOfClass:[NSNull class]]){
		self.playid = dictionary[kMVMvShowPlayPlayid];
	}

	if(![dictionary[kMVMvShowPlayPlayurl] isKindOfClass:[NSNull class]]){
		self.playurl = dictionary[kMVMvShowPlayPlayurl];
	}	
	if(![dictionary[kMVMvShowPlaySubtitle] isKindOfClass:[NSNull class]]){
		self.subtitle = dictionary[kMVMvShowPlaySubtitle];
	}	
	if(![dictionary[kMVMvShowPlayTitle] isKindOfClass:[NSNull class]]){
		self.title = dictionary[kMVMvShowPlayTitle];
	}	
	if(![dictionary[kMVMvShowPlayType] isKindOfClass:[NSNull class]]){
		self.type = dictionary[kMVMvShowPlayType];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.mvvid != nil){
		dictionary[kMVMvShowPlayMvvid] = self.mvvid;
	}
	if(self.picurl != nil){
		dictionary[kMVMvShowPlayPicurl] = self.picurl;
	}
	dictionary[kMVMvShowPlayPlayid] = self.playid;
	if(self.playurl != nil){
		dictionary[kMVMvShowPlayPlayurl] = self.playurl;
	}
	if(self.subtitle != nil){
		dictionary[kMVMvShowPlaySubtitle] = self.subtitle;
	}
	if(self.title != nil){
		dictionary[kMVMvShowPlayTitle] = self.title;
	}
	dictionary[kMVMvShowPlayType] = self.type;
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.mvvid != nil){
		[aCoder encodeObject:self.mvvid forKey:kMVMvShowPlayMvvid];
	}
	if(self.picurl != nil){
		[aCoder encodeObject:self.picurl forKey:kMVMvShowPlayPicurl];
	}
	[aCoder encodeObject:self.playid forKey:kMVMvShowPlayPlayid];	if(self.playurl != nil){
		[aCoder encodeObject:self.playurl forKey:kMVMvShowPlayPlayurl];
	}
	if(self.subtitle != nil){
		[aCoder encodeObject:self.subtitle forKey:kMVMvShowPlaySubtitle];
	}
	if(self.title != nil){
		[aCoder encodeObject:self.title forKey:kMVMvShowPlayTitle];
	}
	[aCoder encodeObject:self.type forKey:kMVMvShowPlayType];
}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.mvvid = [aDecoder decodeObjectForKey:kMVMvShowPlayMvvid];
	self.picurl = [aDecoder decodeObjectForKey:kMVMvShowPlayPicurl];
	self.playid = [aDecoder decodeObjectForKey:kMVMvShowPlayPlayid];
	self.playurl = [aDecoder decodeObjectForKey:kMVMvShowPlayPlayurl];
	self.subtitle = [aDecoder decodeObjectForKey:kMVMvShowPlaySubtitle];
	self.title = [aDecoder decodeObjectForKey:kMVMvShowPlayTitle];
	self.type = [aDecoder decodeObjectForKey:kMVMvShowPlayType];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	MVMvShowPlay *copy = [MVMvShowPlay new];

	copy.mvvid = [self.mvvid copyWithZone:zone];
	copy.picurl = [self.picurl copyWithZone:zone];
	copy.playid = self.playid;
	copy.playurl = [self.playurl copyWithZone:zone];
	copy.subtitle = [self.subtitle copyWithZone:zone];
	copy.title = [self.title copyWithZone:zone];
	copy.type = self.type;

	return copy;
}
@end
